package com.wolfking.jeesite.sso;

import com.wolfking.jeesite.entity.User;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Set;

public interface SsoService {
    String getTokenId(HttpServletRequest request);

    User getTokenUser(String tokenId);

    User getUser();

    Set<String> getUserAuthCodes(Integer userId);

    Set<String> getUserAuthCodes();

    /**
     * 返回用户ID
     * @param tokenId
     * @return
     */
    String logout(String tokenId);

    User login(String username, String password);


    User login(User user);

    Map<String, Object> loginTrace();


    default User checkOtherUser(HttpServletRequest request) {
        // sign 校验失败，处理request，是否有其他的sso登录
        return null;
    }

}
